NAME = yylany/gin_demo
APPNAME = app

.PHONY:dev
dev:
	@echo "start install dependent"
	go mod tidy
	@echo "end install dependent"

.PHONY:run
run:dev
	go run main.go

.PHONY: build
build:
	@echo "building $(APPNAME)......"
	@CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -ldflags '-w' -i -o $(APPNAME) ./main.go
	@echo "success!"

.PHONY: docker
docker: build
	docker build . -t $(NAME):latest

.PHONY: push
push: docker
	docker push $(NAME):latest


